/*
2021-11-8
https://ac.nowcoder.com/acm/contest/22551/H
*/
#include<iostream>
#include<algorithm>
#include<cstring>

using namespace std;

string calc(string tmp)
{
    string res;
    for (int i = 0; i < tmp.size();)
    {
        int j = i;
        while (j < tmp.size() && tmp[j] == tmp[i]) j++;
        int cnt = j - i;
        res += to_string(cnt) + tmp[i];
        i = j;
    }
    return res;
}
string dfs(int n)
{
    if (n == 1) return "1";
    string tmp = dfs(n - 1);
    string res = calc(tmp);
    return res;
}

int main()
{
    string res;
    int n;
    cin >> n;
    cout << dfs(n) << endl;
}
